package com.pig.window;

import java.awt.Container;
import java.awt.Toolkit;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

import com.pig.util.ContinuousMusic;

public class HelpFrame extends JFrame{

	private static final long serialVersionUID = 1L;
	
	private final static int FRAME_WIDTH = 400;
	private final static int FRAME_HEIGHT = 550;
	int gx;
	int gy;
	int screen_width, screen_height;
	
	Container ct;
	
	Icon bkImg;
	JLabel jlBk;
	JLabel setting,team,explain;
	JButton rebound;
	ContinuousMusic helpMusic;
	
	public HelpFrame(){
		helpMusic = new ContinuousMusic("music/hp.wav");
		helpMusic.play();
		ct = this.getContentPane();
		ct.setLayout(null);
		this.setSize(FRAME_WIDTH, FRAME_HEIGHT);
		screen_width = Toolkit.getDefaultToolkit().getScreenSize().width;
		screen_height = Toolkit.getDefaultToolkit().getScreenSize().height;
		this.setLocation((screen_width-FRAME_WIDTH)/2, (screen_height-FRAME_HEIGHT)/2);
		this.setResizable(false);
		
		bkImg = new ImageIcon("images/help.JPG");
System.out.println(bkImg.getIconHeight());
		jlBk = new JLabel(bkImg);
		jlBk.setSize(FRAME_WIDTH, FRAME_HEIGHT);
		
		setting = new JLabel("<html>test1</html>");
		team = new JLabel("<html>test2</html>");
		explain = new JLabel("<html>test3</html>");
		setting.setBounds(30, 30, 280, 50);
		explain.setBounds(30, 100, 280, 50);
		team.setBounds(240,390,150,50);
		
		rebound = new JButton("RETURN");
		rebound.setBounds(280, 460, 80, 30);
		
		
		jlBk.add(setting);
		jlBk.add(explain);
		jlBk.add(team);
		jlBk.add(rebound);
		ct.add(jlBk);
		
		this.setVisible(true);
	}
	
	public static void main(String[] args) {
		new HelpFrame();
	}
}
